1. Field of the Invention
The present invention relates to an image input/output apparatus for temporarily storing image data received from a host in a first data format and outputting the image data after having converted the same to a second data format. More particularly, the invention relates to a printer, such as a laser printer, which stores image (or print) data in the form of an intermediate code and performs printing by expansion of the intermediate code to an image. The present invention also relates to a technique of controlling the printer.
2. Description of Related Art
In a printer, print data (e.g., a printer description language or the like) received from a host, such as a personal computer, are temporarily stored in a buffer after having been converted to a compressed intermediate code on a per-band basis. After initiation of a printing operation, the thus-compressed intermediate code is expanded to bit-map data, and the bit-map data are transferred to a print engine, where the bit map data are printed. To use memory efficiently, print data are converted into intermediate codes and stored in memory on a per-band basis. In response to initiation of the printing operation, the thus-stored intermediate code is expanded to bit-map data, and the bit-map data are transferred to the print engine.
Of the printers having the foregoing structure, a printer using an electrophotographic process, e.g., a laser printer, has a print engine comprising an optical writing system and a photosensitive member (c.g., a drum). Such a print engine usually has a constant print speed. If there is a delay in the print data processing performed by a print controller, e.g., a delay in expansion of the intermediate code to bit-map data, after initiation of a printing operation, the print data processing fails to catch up with the printing operation performed by the print engine, thus causing an overrun error. More specifically, an overrun error arises when the number or area of intermediate codes generated within one band exceeds a predetermined number or area corresponding to the engine speed.
In a conventional technique for reducing the number or area of intermediate codes, a threshold value is determined beforehand. If the number or area of intermediate codes exceeds the threshold value when print data are actually transmitted from the host and when intermediate codes are generated, the intermediate codes are temporarily expanded into bit-map data before a print request is made. Such a method is called an xe2x80x9cadvance expansion operation.xe2x80x9d For instance, in a page printer such as a laser printer, if the number or area of intermediate codes exceeds a certain threshold value during preparation of intermediate codes for one page, the intermediate code is temporarily expanded to bit-map data in a work memory, so long as memory space for advance expansion can be reserved. Intermediate codes are again reproduced from the thus-expanded bit-map data and are retained as compressed data.
The original intention of storing image data into memory in the form of an intermediate code is to save memory. However, some image data becomes larger in size (i.e., the amount of memory required) when in the form of an intermediate code than when in the form of real image data. To store intermediate codes instead of keeping the actual image data by a band buffer may disadvantageously cause an increase in the amount of memory used. In the case of text data, intermediate codes are made up of bit-map data based on the address in the memory of individual characters and information regarding the locations of the characters within a page. In the case of graphic data, intermediate codes are made up of path data specifying the profile of a drawing. Further, in the case of image data such as photographic image data, intermediate codes are made up of bit-map data regarding a photographic image and information regarding the position of the image within a page. In a case where a single page comprises a plurality of complicated minute characters and drawings, the amount of information regarding the characters and drawings and the amount of path data become enormous. Such a page requires a larger amount of memory when in the form of an intermediate code than when in the form of real image data. As mentioned above, depending on the degree of complication of intermediate codes when image data are converted to intermediate codes, the image data are subjected to advance expansion, so long as memory can be reserved, thereby preventing an overrun error.
In such a case, the following two techniques have conventionally been employed in order to prevent an overrun error while guaranteeing effective use of limited memory.
According to a first conventional technique, the intermediate codes, each of which is calculated for each band, are sorted according to a degree of complication. In descending order, image data are expanded to an image beforehand until there is achieved a threshold value, which corresponds to the point at which an overrun error arises. When memory for advance expansion has run out, advance expansion of image data into an image is aborted.
According a second conventional technique, the intermediate codes, each of which is calculated for each band, are compared with the threshold value in view of degree of complication. Data regarding a band whose degree of complication is greater than the threshold value are expanded to an image beforehand. If memory for advance expansion becomes exhausted during advance expansion, advance expansion of the image data is aborted upon exhaustion.
The first conventional technique enables reduction of the chance of an overrun by sorting the intermediate codes according to degree of complication, on a per-band basis. However, such a sorting operation consumes much time, thereby resulting in a reduction in overall throughput.
According to the second conventional technique, setting a threshold value to an appropriate value, according to which the degree of complication of an intermediate value is determined, is very difficult. In effect, complete prevention of an overrun error is impossible.
The object of the present invention is to provide an image input/output apparatus, such as a printer, which enables an improvement in throughput by shortening sorting time as compared to that required by the conventional technique, as well as to provide effective prevention of an overrun error.
In order to solve the previously-described problems, according to the present invention, a plurality of threshold values which ensure a printing operation are prepared, and the intermediate codes arc sorted according, to degree of complication, with regard to only bands which are excluded in advance from printable bands by use of the threshold values.
According to a first aspect of the present invention, there is provided a printer which converts print data to a first data format for each of a plurality of predetermined regions, stores the print data of the first data format into memory, reads from the memory the print data in the first data format for each of the regions, converts the read print data of the first data format to a second data format in response to a print request to thereby expand the print data in the memory, and transfers the print data of the second data format to a print engine, said printer comprising:
a determiner which determines, for each of said plurality of predetermined regions, whether or not a processing criteria relating to an amount of processing required for converting the print data from the first data format to the second data format exceeds a predetermined threshold value;
a sorter receiving an output from said determiner,
wherein said sorter sorts only candidate regions having processing criteria determined to exceed the predetermined threshold value; and
wherein said sorter sorts the candidate regions in descending order of the processing criteria after said determiner determines whether the threshold value has been exceeded for all of the predetermined regions;
a converter which converts the print data from the first data format into the second data format in descending order of the processing criteria for each of the regions; and
a print engine to print data based on the print data of the second data format.
According to the invention, only the regions having processing criteria which have been determined to exceed the threshold value are taken as candidates for sorting. Hence, when compared to the case where print data are sorted for all the regions, sorting time can be shortened.
Preferably, the first data format corresponds to an intermediate code, and the second data format corresponds to bit-map data. Further, the processing criteria relating to the amount of processing includes at least a time required to convert the print data from the intermediate code to the bit-map data, for each of the regions. Only the regions whose conversion times have been determined to exceed the predetermined threshold value are taken as candidates for sorting.
The time required to convert the print data from the intermediate code to the bit-map data is compared with a threshold value, and only the print data regarding the regions whose conversion times have been determined to exceed the threshold value are sorted in descending order of conversion time, thereby shortening a sorting time and enabling effective prevention of an overrun error.
Preferably, the processing criteria relating to the amount of processing further includes the ratio of area of the intermediate code to that of the bit-map data. For the regions whose area ratio has been determined to exceed a predetermined threshold value, the print data related to the regions are converted from the first data format to the second data format regardless of their conversion time, and the data thus converted to the second data format are stored in the memory.
It is believed that with the selective sorting of the band regions according to whether or not an associated processing criteria exceeds a certain value, the probability of occurrence of an overrun error can be diminished further .
Preferably, the print data can be converted to the second data format beforehand and stored into the memory, as long as the amount of memory for storing the print data can be reserved.
As a result, an overrun error can be prevented without an unnecessary increase in memory.
Preferably, a plurality of different values are prepared as the predetermined threshold values, and one of the plurality of values is selected according to a print speed. Accordingly, the invention permits prioritizing of the print process based on print speed or avoidance of an overrun error.